﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data;
namespace CCF20Model
{
     public partial class CCF20Entities 
    {
         public override int SaveChanges(System.Data.Objects.SaveOptions options)
         {
             try
             {
                 return base.SaveChanges(options);
             }
             catch (OptimisticConcurrencyException ex)
             {
                 var conflictEntity = ex.StateEntries[0].Entity;
                 LoggerHelper.LogCCF20(string.Format("database conflict detected, refresh {0} with ClientWin", conflictEntity.GetType().Name));
                 Refresh(RefreshMode.ClientWins, conflictEntity);
                 return SaveChanges(options);
             }
         }
    }
}
